
/*---------------------------------------------------------------------------

  FILENAME:
        cmdbufqueue.h

  PURPOSE:
	Provide a command queue buf for income socket command data.

  REVISION HISTORY:
        Date            Engineer        Revision        Remarks
	16/02/2009	Vincent. Young	1.2	cmdqueue

  NOTES:


  LICENSE:
        Copyright (c) 2009, Vincent Young (vincentgodyoung@hotmail.com)

        This source code is released for free distribution under the terms
        of the GNU General Public License.

----------------------------------------------------------------------------*/

// system library include files
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>

// local project include files

#define CMDLENGTH 64
// max size of cmd string, 
// max cmd string of davis serial protocol is calfix 46
// 
#define MAXCMDS 16
// max cmds number as willing

typedef struct cmd{
	struct cmd * nextcmd;
	int cmdlength;
	int socketid;
	void * cmd;
} cmdstring;

extern cmdstring *firstcmd, *lastcmd;
extern int cmdsum;

int cmdaddlast(void *buf, int len, int socketid);

int cmddelfirst();

// 查找方法 blabla
